package com.student.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * OccupationType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Occupation_Type", schema = "dbo", catalog = "StudentManager")
public class OccupationType implements java.io.Serializable {

	// Fields

	private Long occupationTypeId;
	private String occupationTypeName;
	private Set<EmploymentSituation> employmentSituations = new HashSet<EmploymentSituation>(
			0);
	private Set<EmployMessage> employMessages = new HashSet<EmployMessage>(0);

	// Constructors

	/** default constructor */
	public OccupationType() {
	}

	/** minimal constructor */
	public OccupationType(Long occupationTypeId, String occupationTypeName) {
		this.occupationTypeId = occupationTypeId;
		this.occupationTypeName = occupationTypeName;
	}

	/** full constructor */
	public OccupationType(Long occupationTypeId, String occupationTypeName,
			Set<EmploymentSituation> employmentSituations,
			Set<EmployMessage> employMessages) {
		this.occupationTypeId = occupationTypeId;
		this.occupationTypeName = occupationTypeName;
		this.employmentSituations = employmentSituations;
		this.employMessages = employMessages;
	}

	// Property accessors
	@Id
	@Column(name = "Occupation_Type_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getOccupationTypeId() {
		return this.occupationTypeId;
	}

	public void setOccupationTypeId(Long occupationTypeId) {
		this.occupationTypeId = occupationTypeId;
	}

	@Column(name = "Occupation_Type_Name", nullable = false, length = 20)
	public String getOccupationTypeName() {
		return this.occupationTypeName;
	}

	public void setOccupationTypeName(String occupationTypeName) {
		this.occupationTypeName = occupationTypeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "occupationType")
	public Set<EmploymentSituation> getEmploymentSituations() {
		return this.employmentSituations;
	}

	public void setEmploymentSituations(
			Set<EmploymentSituation> employmentSituations) {
		this.employmentSituations = employmentSituations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "occupationType")
	public Set<EmployMessage> getEmployMessages() {
		return this.employMessages;
	}

	public void setEmployMessages(Set<EmployMessage> employMessages) {
		this.employMessages = employMessages;
	}

}